﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace ProductStore.Models
{
    public class Order
    {
        [ScaffoldColumn(false)]
        public int OrderId { get; set; }

        [ScaffoldColumn(false)]
        public string Username { get; set; }

        //[Required(ErrorMessage = "First Name is required")]
        //[Display(Name = "First Name")]
        //[StringLength(160)]
        //public string FirstName { get; set; }

        //[Required(ErrorMessage = "Last Name is required")]
        //[Display(Name = "Last Name")]
        //[StringLength(160)]
        //public string LastName { get; set; }

        //[Required(ErrorMessage = "Address is required")]
        //[StringLength(70)]
        //public string Address { get; set; }

        //[Required(ErrorMessage = "City is required")]
        //[StringLength(40)]
        //public string City { get; set; }

        //[Required(ErrorMessage = "State is required")]
        //[StringLength(40)]
        //public string State { get; set; }

        //[Required(ErrorMessage = "Postal Code is required")]
        //[Display(Name = "Postal Code")]
        //[StringLength(10)]
        //public string PostalCode { get; set; }

        //[Required(ErrorMessage = "Country is required")]
        //[StringLength(40)]
        //public string Country { get; set; }

        [Required(ErrorMessage = "Phone is required")]
        [StringLength(24)]
        public string Phone { get; set; }

        [Required(ErrorMessage = "Email Address is required")]
        [Display(Name = "Email Address")]
        [RegularExpression(@"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}",
            ErrorMessage = "Email is is not valid.")]
        [DataType(DataType.EmailAddress)]
        public string Email { get; set; }

        [ScaffoldColumn(false)]
        public decimal Total { get; set; }

        [ScaffoldColumn(false)]
        public DateTime OrderDate { get; set; }

        public virtual List<OrderDetail> OderDetails { get; set; }
    }
}
